Skip to content

Fix test failures for real DB mode#116

Merged
kelleyloder merged 1 commit into
kloderfrom
mockdb_kloder_fixes
Apr 30, 2026
Merged

Fix test failures for real DB mode#116
kelleyloder merged 1 commit into
kloderfrom
mockdb_kloder_fixes

Conversation

@RahulRengeshOfficial
Copy link
Copy Markdown

  • Fix TestDeleteLogRepoSettingsbyId_Success: use uniqueID instead of hardcoded 'delete-me'
  • Remove unnecessary DeleteAllEntities() from pure validation tests
  • Add delay after create before delete for Cassandra consistency

- Fix TestDeleteLogRepoSettingsbyId_Success: use uniqueID instead of hardcoded 'delete-me'
- Remove unnecessary DeleteAllEntities() from pure validation tests
- Add delay after create before delete for Cassandra consistency
Copilot AI review requested due to automatic review settings April 30, 2026 16:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts DCM log repository settings tests to be more reliable when running against a real database (non-mock), reducing cross-test collisions and unnecessary DB operations.

Changes:

  • Remove DeleteAllEntities() usage from validation-only tests that return before any DB interaction.
  • Update TestDeleteLogRepoSettingsbyId_Success to delete/verify using the generated unique ID instead of a hardcoded ID.
  • Add a short wait after create (and keep an existing wait after delete) to mitigate cache/consistency timing issues in real DB mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +605 to +609
// Allow cache to refresh after create
time.Sleep(100 * time.Millisecond)

// Delete it - use the same uniqueID
respEntity := DeleteLogRepoSettingsbyId(uniqueID, "stb")
Comment on lines 614 to +618
// Allow cache to refresh
time.Sleep(100 * time.Millisecond)

// Verify deletion
deleted := GetLogRepoSettings("delete-me")
deleted := GetLogRepoSettings(uniqueID)
@kelleyloder kelleyloder merged commit e5a94a3 into kloder Apr 30, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants